package com.web.FourthService.Controller;

import com.web.FourthService.Service.FourthService;
import lombok.extern.slf4j.Slf4j;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/fourth/api")
public class FourthController {

    public FourthService fourthService;
    public FourthController(FourthService fourthService) {
        this.fourthService = fourthService;
    }
    @GetMapping("/subtract")
    public ResponseEntity<Void> subtract(@RequestParam(value = "id") Integer id, @RequestParam(value = "number") int number) {
        log.info("经过了第四接口");
        fourthService.subtractCart(id,number);
        return ResponseEntity.noContent().build();
    }
}
